package com.example;

import com.example.common.netty.HandlerNetty;
import com.example.common.netty.NettyServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

import java.net.InetSocketAddress;

@SpringBootApplication
public class SpringbootAnnotationApplication {
    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(SpringbootAnnotationApplication.class, args);
        /**
         * 启动netty
         */
        HandlerNetty bean = context.getBean(HandlerNetty.class);
        NettyServer nettyServer = new NettyServer();
        nettyServer.start(new InetSocketAddress("127.0.0.1", 8090));
    }

}
